<?php

namespace App\Validate;

class ArticleValidation extends BaseValidation
{
    //验证规则
    protected $rule =[
        'title'=>'required',
        'content'=>'required',
        'id'=>'required',
    ];
    //自定义验证信息
    protected $message = [
        'id.required'=>'ID 必须',
        'title.required'=>'标题 必须',
        'content.required'=>'内容 必须',
    ];

    //自定义场景
    protected $scene = [
        'add'=>"title,content",
        'edit_show'=> 'id',
        'change'=> 'id,status',
        'edit_save'=>"id,title,content",
    ];
}